<%@include file="include_top.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>BidPirate - Account</title>
</head>
<body>
<c:if test="${not session.loggedIn}">
<p class="info">Security info: your password is encrypted to <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" target="wiki">NSA approved standards</a>.</p>
<p>Log in or create an account.</p>
</c:if>
<c:if test="${session.loggedIn}">
<p>Update your account or log out.</p>
</c:if>
<form:form modelAttribute="user">
<form:errors path="*" cssClass="alert" element="p"/>
<table>
	<tr>
		<td>eBay id:</td>
		<td><form:input path="username"/></td>
	</tr>
	<tr>
		<td>eBay password:&nbsp;</td>
		<td>
			<form:password path="password"/>
<c:if test="${not session.loggedIn}">
			<input type="submit" value="Log in" onclick="this.disabled=true;action='account-logIn.html';submit()"/>
</c:if>
		</td>
	</tr>
	<tr class="line-break"></tr>
<!--	<tr>-->
<!--		<td>Email:</td>-->
<!--		<td><form:input path="email"/></td>-->
<!--	</tr>-->
	<tr>
		<td>Region:</td>
		<td>
			<form:select path="regionCode">
				<form:option value="US">ebay.com</form:option>
				<form:option value="UK">ebay.co.uk</form:option>
			</form:select>
		</td>
	</tr>
</table>
<c:if test="${not session.loggedIn}">
<p><input type="submit" value="Create" onclick="this.disabled=true;action='account-create.html';submit()"/></p>
</c:if>
<c:if test="${session.loggedIn}">
<p>
	<input type="submit" value="Update" onclick="this.disabled=true;action='account-update.html';submit()"/>
	<input type="button" value="Log out" onclick="location.href='account-logOut.html'"/>
</p>
</c:if>
</form:form>
<script>document.forms[0].elements[0].focus();</script>
</body>
</html>
